package com.demo.design.behavioral.memento;

public class MementoMain {

    public static void main(String[] args) {
        String wife = "吼姆拉";
        CareTaker careTaker = new CareTaker();
        Originator originator = new Originator();
        originator.setState(wife);
        careTaker.setMemento(originator.createNewMemento());
        originator.setState("菲特");
        careTaker.setMemento(originator.createNewMemento());
        originator.setState("美游");
        careTaker.setMemento(originator.createNewMemento());
        originator.setState("步音");
        originator.backState(careTaker.getMemento());

        System.err.println(originator.getState());
    }
}
